home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 January: Mac OS SDK / Dev.CD Jan 00 SDK1.toast / Development Kits / Mac OS / QuickTime / QuickTime 3 Interfaces & Libs / QTDevWin / CIncludes / ImageCodec.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-21  |  48.4 KB  |  1,413 lines  |  [TEXT/dosa]

  1. /*
  2.      File:        ImageCodec.h
  3.  
  4.      Contains:    QuickTime Interfaces.
  5.  
  6.      Version:    Technology:    QuickTime 3.0
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1990-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __IMAGECODEC__
  19. #define __IMAGECODEC__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24. #ifndef __QUICKDRAW__
  25. #include <Quickdraw.h>
  26. #endif
  27. #ifndef __IMAGECOMPRESSION__
  28. #include <ImageCompression.h>
  29. #endif
  30. #ifndef __COMPONENTS__
  31. #include <Components.h>
  32. #endif
  33. #ifndef __MOVIES__
  34. #include <Movies.h>
  35. #endif
  36. #ifndef __GXTYPES__
  37. #include <GXTypes.h>
  38. #endif
  39.  
  40.  
  41.  
  42. #if PRAGMA_ONCE
  43. #pragma once
  44. #endif
  45.  
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49.  
  50. #if PRAGMA_IMPORT
  51. #pragma import on
  52. #endif
  53.  
  54. #if PRAGMA_STRUCT_ALIGN
  55.     #pragma options align=mac68k
  56. #elif PRAGMA_STRUCT_PACKPUSH
  57.     #pragma pack(push, 2)
  58. #elif PRAGMA_STRUCT_PACK
  59.     #pragma pack(2)
  60. #endif
  61.  
  62.  
  63. /*    codec capabilities flags    */
  64.  
  65. enum {
  66.     codecCanScale                = 1L << 0,
  67.     codecCanMask                = 1L << 1,
  68.     codecCanMatte                = 1L << 2,
  69.     codecCanTransform            = 1L << 3,
  70.     codecCanTransferMode        = 1L << 4,
  71.     codecCanCopyPrev            = 1L << 5,
  72.     codecCanSpool                = 1L << 6,
  73.     codecCanClipVertical        = 1L << 7,
  74.     codecCanClipRectangular        = 1L << 8,
  75.     codecCanRemapColor            = 1L << 9,
  76.     codecCanFastDither            = 1L << 10,
  77.     codecCanSrcExtract            = 1L << 11,
  78.     codecCanCopyPrevComp        = 1L << 12,
  79.     codecCanAsync                = 1L << 13,
  80.     codecCanMakeMask            = 1L << 14,
  81.     codecCanShift                = 1L << 15,
  82.     codecCanAsyncWhen            = 1L << 16,
  83.     codecCanShieldCursor        = 1L << 17,
  84.     codecCanManagePrevBuffer    = 1L << 18,
  85.     codecHasVolatileBuffer        = 1L << 19,
  86.     codecWantsRegionMask        = 1L << 20,
  87.     codecImageBufferIsOnScreen    = 1L << 21,
  88.     codecWantsDestinationPixels    = 1L << 22,
  89.     codecWantsSpecialScaling    = 1L << 23,
  90.     codecHandlesInputs            = 1L << 24,
  91.     codecCanDoIndirectSurface    = 1L << 25,
  92.     codecIsSequenceSensitive    = 1L << 26,
  93.     codecRequiresOffscreen        = 1L << 27,
  94.     codecRequiresMaskBits        = 1L << 28,
  95.     codecCanRemapResolution        = 1L << 29,
  96.     codecIsDirectToScreenOnly    = 1L << 30,
  97.     codecCanLockSurface            = 1L << 31
  98. };
  99.  
  100.  
  101. struct CodecCapabilities {
  102.     long                             flags;
  103.     short                             wantedPixelSize;
  104.     short                             extendWidth;
  105.     short                             extendHeight;
  106.     short                             bandMin;
  107.     short                             bandInc;
  108.     short                             pad;
  109.     unsigned long                     time;
  110. };
  111. typedef struct CodecCapabilities        CodecCapabilities;
  112. /*    codec condition flags    */
  113.  
  114. enum {
  115.     codecConditionFirstBand        = 1L << 0,
  116.     codecConditionLastBand        = 1L << 1,
  117.     codecConditionFirstFrame    = 1L << 2,
  118.     codecConditionNewDepth        = 1L << 3,
  119.     codecConditionNewTransform    = 1L << 4,
  120.     codecConditionNewSrcRect    = 1L << 5,
  121.     codecConditionNewMask        = 1L << 6,
  122.     codecConditionNewMatte        = 1L << 7,
  123.     codecConditionNewTransferMode = 1L << 8,
  124.     codecConditionNewClut        = 1L << 9,
  125.     codecConditionNewAccuracy    = 1L << 10,
  126.     codecConditionNewDestination = 1L << 11,
  127.     codecConditionFirstScreen    = 1L << 12,
  128.     codecConditionDoCursor        = 1L << 13,
  129.     codecConditionCatchUpDiff    = 1L << 14,
  130.     codecConditionMaskMayBeChanged = 1L << 15,
  131.     codecConditionToBuffer        = 1L << 16,
  132.     codecConditionCodecChangedMask = 1L << 31
  133. };
  134.  
  135.  
  136.  
  137. enum {
  138.     codecInfoResourceType        = FOUR_CHAR_CODE('cdci'),        /* codec info resource type */
  139.     codecInterfaceVersion        = 2                                /* high word returned in component GetVersion */
  140. };
  141.  
  142.  
  143. struct CDSequenceDataSourceQueueEntry {
  144.     void *                            nextBusy;
  145.  
  146.     long                             descSeed;
  147.     Handle                             dataDesc;
  148.     void *                            data;
  149.     long                             dataSize;
  150.  
  151.     long                             useCount;
  152.  
  153.     TimeValue                         frameTime;
  154.     TimeValue                         frameDuration;
  155.     TimeValue                         timeScale;
  156. };
  157. typedef struct CDSequenceDataSourceQueueEntry CDSequenceDataSourceQueueEntry;
  158. typedef CDSequenceDataSourceQueueEntry * CDSequenceDataSourceQueueEntryPtr;
  159.  
  160. struct CDSequenceDataSource {
  161.     long                             recordSize;
  162.  
  163.     void *                            next;
  164.  
  165.     ImageSequence                     seqID;
  166.     ImageSequenceDataSource         sourceID;
  167.     OSType                             sourceType;
  168.     long                             sourceInputNumber;
  169.     void *                            dataPtr;
  170.     Handle                             dataDescription;
  171.     long                             changeSeed;
  172.     ICMConvertDataFormatUPP         transferProc;
  173.     void *                            transferRefcon;
  174.     long                             dataSize;
  175.  
  176.                                                                 /* fields available in QT 3 and later */
  177.  
  178.     QHdrPtr                         dataQueue;                    /* queue of CDSequenceDataSourceQueueEntry structures*/
  179.  
  180.     void *                            originalDataPtr;
  181.     long                             originalDataSize;
  182.     Handle                             originalDataDescription;
  183.     long                             originalDataDescriptionSeed;
  184. };
  185. typedef struct CDSequenceDataSource        CDSequenceDataSource;
  186. typedef CDSequenceDataSource *            CDSequenceDataSourcePtr;
  187.  
  188. struct ICMFrameTimeInfo {
  189.     wide                             startTime;
  190.     long                             scale;
  191.     long                             duration;
  192. };
  193. typedef struct ICMFrameTimeInfo            ICMFrameTimeInfo;
  194. typedef ICMFrameTimeInfo *                ICMFrameTimeInfoPtr;
  195.  
  196. struct CodecCompressParams {
  197.     ImageSequence                     sequenceID;                    /* precompress,bandcompress */
  198.     ImageDescriptionHandle             imageDescription;            /* precompress,bandcompress */
  199.     Ptr                             data;
  200.     long                             bufferSize;
  201.     long                             frameNumber;
  202.     long                             startLine;
  203.     long                             stopLine;
  204.     long                             conditionFlags;
  205.     CodecFlags                         callerFlags;
  206.     CodecCapabilities *                capabilities;                /* precompress,bandcompress */
  207.     ICMProgressProcRecord             progressProcRecord;
  208.     ICMCompletionProcRecord         completionProcRecord;
  209.     ICMFlushProcRecord                 flushProcRecord;
  210.  
  211.     PixMap                             srcPixMap;                    /* precompress,bandcompress */
  212.     PixMap                             prevPixMap;
  213.     CodecQ                             spatialQuality;
  214.     CodecQ                             temporalQuality;
  215.     Fixed                             similarity;
  216.     DataRateParamsPtr                 dataRateParams;
  217.     long                             reserved;
  218.  
  219.                                                                 /* The following fields only exist for QuickTime 2.1 and greater */
  220.     UInt16                             majorSourceChangeSeed;
  221.     UInt16                             minorSourceChangeSeed;
  222.     CDSequenceDataSourcePtr         sourceData;
  223.  
  224.                                                                 /* The following fields only exit for QuickTime 2.5 and greater */
  225.     long                             preferredPacketSizeInBytes;
  226.  
  227.                                                                 /* The following fields only exit for QuickTime 3.0 and greater */
  228.     long                             requestedBufferWidth;        /* must set codecWantsSpecialScaling to indicate this field is valid*/
  229.     long                             requestedBufferHeight;        /* must set codecWantsSpecialScaling to indicate this field is valid*/
  230. };
  231. typedef struct CodecCompressParams        CodecCompressParams;
  232.  
  233. struct CodecDecompressParams {
  234.     ImageSequence                     sequenceID;                    /* predecompress,banddecompress */
  235.     ImageDescriptionHandle             imageDescription;            /* predecompress,banddecompress */
  236.     Ptr                             data;
  237.     long                             bufferSize;
  238.     long                             frameNumber;
  239.     long                             startLine;
  240.     long                             stopLine;
  241.     long                             conditionFlags;
  242.     CodecFlags                         callerFlags;
  243.     CodecCapabilities *                capabilities;                /* predecompress,banddecompress */
  244.     ICMProgressProcRecord             progressProcRecord;
  245.     ICMCompletionProcRecord         completionProcRecord;
  246.     ICMDataProcRecord                 dataProcRecord;
  247.  
  248.     CGrafPtr                         port;                        /* predecompress,banddecompress */
  249.     PixMap                             dstPixMap;                    /* predecompress,banddecompress */
  250.     BitMapPtr                         maskBits;
  251.     PixMapPtr                         mattePixMap;
  252.     Rect                             srcRect;                    /* predecompress,banddecompress */
  253.     MatrixRecord *                    matrix;                        /* predecompress,banddecompress */
  254.     CodecQ                             accuracy;                    /* predecompress,banddecompress */
  255.     short                             transferMode;                /* predecompress,banddecompress */
  256.     ICMFrameTimePtr                 frameTime;                    /* banddecompress */
  257.     long                             reserved[1];
  258.                                                                 /* The following fields only exist for QuickTime 2.0 and greater */
  259.     SInt8                             matrixFlags;                /* high bit set if 2x resize */
  260.     SInt8                             matrixType;
  261.     Rect                             dstRect;                    /* only valid for simple transforms */
  262.                                                                 /* The following fields only exist for QuickTime 2.1 and greater */
  263.     UInt16                             majorSourceChangeSeed;
  264.     UInt16                             minorSourceChangeSeed;
  265.     CDSequenceDataSourcePtr         sourceData;
  266.  
  267.     RgnHandle                         maskRegion;
  268.  
  269.                                                                 /* The following fields only exist for QuickTime 2.5 and greater */
  270.  
  271.     OSType **                        wantedDestinationPixelTypes; /* Handle to 0-terminated list of OSTypes */
  272.  
  273.     long                             screenFloodMethod;
  274.     long                             screenFloodValue;
  275.     short                             preferredOffscreenPixelSize;
  276.  
  277.                                                                 /* The following fields only exist for QuickTime 3.0 and greater */
  278.     ICMFrameTimeInfoPtr             syncFrameTime;                /* banddecompress */
  279.     Boolean                         needUpdateOnTimeChange;        /* banddecompress */
  280.     Boolean                         enableBlackLining;
  281.     Boolean                         needUpdateOnSourceChange;    /* band decompress */
  282.     Boolean                         pad;
  283.  
  284.     long                             unused;
  285.  
  286.     CGrafPtr                         finalDestinationPort;
  287.  
  288.     long                             requestedBufferWidth;        /* must set codecWantsSpecialScaling to indicate this field is valid*/
  289.     long                             requestedBufferHeight;        /* must set codecWantsSpecialScaling to indicate this field is valid*/
  290. };
  291. typedef struct CodecDecompressParams    CodecDecompressParams;
  292.  
  293. enum {
  294.     matrixFlagScale2x            = 1L << 7,
  295.     matrixFlagScale1x            = 1L << 6,
  296.     matrixFlagScaleHalf            = 1L << 5
  297. };
  298.  
  299.  
  300. enum {
  301.     kScreenFloodMethodNone        = 0,
  302.     kScreenFloodMethodKeyColor    = 1,
  303.     kScreenFloodMethodAlpha        = 2
  304. };
  305.  
  306.  
  307. enum {
  308.     kFlushLastQueuedFrame        = 0,
  309.     kFlushFirstQueuedFrame        = 1
  310. };
  311.  
  312.  
  313. enum {
  314.     kNewImageGWorldErase        = 1L << 0
  315. };
  316.  
  317.  
  318. struct ImageSubCodecDecompressCapabilities {
  319.     long                             recordSize;                    /* sizeof(ImageSubCodecDecompressCapabilities)*/
  320.     long                             decompressRecordSize;        /* size of your codec's decompress record*/
  321.     Boolean                         canAsync;                    /* default true*/
  322.     UInt8                             pad[3];
  323. };
  324. typedef struct ImageSubCodecDecompressCapabilities ImageSubCodecDecompressCapabilities;
  325.  
  326. enum {
  327.     kCodecFrameTypeUnknown        = 0,
  328.     kCodecFrameTypeKey            = 1,
  329.     kCodecFrameTypeDifference    = 2,
  330.     kCodecFrameTypeDroppableDifference = 3
  331. };
  332.  
  333.  
  334. struct ImageSubCodecDecompressRecord {
  335.     Ptr                             baseAddr;
  336.     long                             rowBytes;
  337.     Ptr                             codecData;
  338.     ICMProgressProcRecord             progressProcRecord;
  339.     ICMDataProcRecord                 dataProcRecord;
  340.     void *                            userDecompressRecord;        /* pointer to codec-specific per-band data*/
  341.     UInt8                             frameType;
  342.     UInt8                             pad[3];
  343. };
  344. typedef struct ImageSubCodecDecompressRecord ImageSubCodecDecompressRecord;
  345. /* name of parameters or effect -- placed in root container, required */
  346.  
  347. enum {
  348.     kParameterTitleName            = FOUR_CHAR_CODE('name'),
  349.     kParameterTitleID            = 1
  350. };
  351.  
  352. /* codec sub-type of parameters or effect -- placed in root container, required */
  353.  
  354. enum {
  355.     kParameterWhatName            = FOUR_CHAR_CODE('what'),
  356.     kParameterWhatID            = 1
  357. };
  358.  
  359. /* effect version -- placed in root container, optional, but recommended */
  360.  
  361. enum {
  362.     kParameterVersionName        = FOUR_CHAR_CODE('vers'),
  363.     kParameterVersionID            = 1
  364. };
  365.  
  366. /* is effect repeatable -- placed in root container, optional, default is TRUE*/
  367.  
  368. enum {
  369.     kParameterRepeatableName    = FOUR_CHAR_CODE('pete'),
  370.     kParameterRepeatableID        = 1
  371. };
  372.  
  373.  
  374. enum {
  375.     kParameterRepeatableTrue    = 1,
  376.     kParameterRepeatableFalse    = 0
  377. };
  378.  
  379. /* substitution codec in case effect is missing -- placed in root container, recommended */
  380.  
  381. enum {
  382.     kParameterAlternateCodecName = FOUR_CHAR_CODE('subs'),
  383.     kParameterAlternateCodecID    = 1
  384. };
  385.  
  386. /* maximum number of sources -- placed in root container, required */
  387.  
  388. enum {
  389.     kParameterSourceCountName    = FOUR_CHAR_CODE('srcs'),
  390.     kParameterSourceCountID        = 1
  391. };
  392.  
  393.  
  394.  
  395. enum {
  396.     kParameterDependencyName    = FOUR_CHAR_CODE('deep'),
  397.     kParameterDependencyID        = 1
  398. };
  399.  
  400.  
  401. enum {
  402.     kParameterListDependsUponColorProfiles = FOUR_CHAR_CODE('prof'),
  403.     kParameterListDependsUponFonts = FOUR_CHAR_CODE('font')
  404. };
  405.  
  406.  
  407. struct ParameterDependancyRecord {
  408.     long                             dependCount;
  409.     OSType                             depends[1];
  410. };
  411. typedef struct ParameterDependancyRecord ParameterDependancyRecord;
  412. /*
  413.    enumeration list in container -- placed in root container, optional unless used by a
  414.    parameter in the list
  415. */
  416.  
  417. enum {
  418.     kParameterEnumList            = FOUR_CHAR_CODE('enum')
  419. };
  420.  
  421.  
  422. struct EnumValuePair {
  423.     long                             value;
  424.     Str255                             name;
  425. };
  426. typedef struct EnumValuePair            EnumValuePair;
  427.  
  428. struct EnumListRecord {
  429.     long                             enumCount;                    /* number of enumeration items to follow*/
  430.     EnumValuePair                     values[1];                    /* values and names for them, packed */
  431. };
  432. typedef struct EnumListRecord            EnumListRecord;
  433. /* atom type of parameter*/
  434.  
  435. enum {
  436.     kParameterAtomTypeAndID        = FOUR_CHAR_CODE('type')
  437. };
  438.  
  439.  
  440. enum {
  441.     kNoAtom                        = FOUR_CHAR_CODE('none'),        /* atom type for no data got/set*/
  442.     kAtomNoFlags                = 0x00000000,
  443.     kAtomNotInterpolated        = 0x00000001,                    /* atom can never be interpolated*/
  444.     kAtomInterpolateIsOptional    = 0x00000002                    /* atom can be interpolated, but it is an advanced user operation*/
  445. };
  446.  
  447.  
  448. struct ParameterAtomTypeAndID {
  449.     QTAtomType                         atomType;                    /* type of atom this data comes from/goes into*/
  450.     QTAtomID                         atomID;                        /* ID of atom this data comes from/goes into*/
  451.     long                             atomFlags;                    /* options for this atom*/
  452.     Str255                             atomName;                    /* name of this value type*/
  453. };
  454. typedef struct ParameterAtomTypeAndID    ParameterAtomTypeAndID;
  455. /* data type of a parameter*/
  456.  
  457. enum {
  458.     kParameterDataType            = FOUR_CHAR_CODE('data')
  459. };
  460.  
  461.  
  462. enum {
  463.     kParameterTypeDataLong        = kTweenTypeLong,                /* integer value*/
  464.     kParameterTypeDataFixed        = kTweenTypeFixed,                /* fixed point value*/
  465.     kParameterTypeDataRGBValue    = kTweenTypeRGBColor,            /* RGBColor data*/
  466.     kParameterTypeDataDouble    = kTweenTypeQTFloatDouble,        /* IEEE 64 bit floating point value*/
  467.     kParameterTypeDataText        = FOUR_CHAR_CODE('text'),        /* editable text item*/
  468.     kParameterTypeDataEnum        = FOUR_CHAR_CODE('enum'),        /* enumerated lookup value*/
  469.     kParameterTypeDataBitField    = FOUR_CHAR_CODE('bool'),        /* bit field value (something that holds boolean(s))*/
  470.     kParameterTypeDataImage        = FOUR_CHAR_CODE('imag')        /* reference to an image via Picture data*/
  471. };
  472.  
  473.  
  474. struct ParameterDataType {
  475.     OSType                             dataType;                    /* type of data this item is stored as*/
  476. };
  477. typedef struct ParameterDataType        ParameterDataType;
  478. /*
  479.    alternate (optional) data type -- main data type always required.  
  480.    Must be modified or deleted when modifying main data type.
  481.    Main data type must be modified when alternate is modified.
  482. */
  483.  
  484. enum {
  485.     kParameterAlternateDataType    = FOUR_CHAR_CODE('alt1'),
  486.     kParameterTypeDataColorValue = FOUR_CHAR_CODE('cmlr'),        /* CMColor data (supported on machines with ColorSync)*/
  487.     kParameterTypeDataCubic        = FOUR_CHAR_CODE('cubi'),        /* cubic bezier(s) (no built-in support)*/
  488.     kParameterTypeDataNURB        = FOUR_CHAR_CODE('nurb')        /* nurb(s) (no built-in support)*/
  489. };
  490.  
  491.  
  492. struct ParameterAlternateDataEntry {
  493.     OSType                             dataType;                    /* type of data this item is stored as*/
  494.     QTAtomType                         alternateAtom;                /* where to store*/
  495. };
  496. typedef struct ParameterAlternateDataEntry ParameterAlternateDataEntry;
  497.  
  498. struct ParameterAlternateDataType {
  499.     long                             numEntries;
  500.     ParameterAlternateDataEntry     entries[1];
  501. };
  502. typedef struct ParameterAlternateDataType ParameterAlternateDataType;
  503. /* legal values for the parameter*/
  504.  
  505. enum {
  506.     kParameterDataRange            = FOUR_CHAR_CODE('rang')
  507. };
  508.  
  509.  
  510. enum {
  511.     kNoMinimumLongFixed            = 0x7FFFFFFF,                    /* ignore minimum/maxiumum values*/
  512.     kNoMaximumLongFixed            = (long)0x80000000,
  513.     kNoScaleLongFixed            = 0,                            /* don't perform any scaling of value*/
  514.     kNoPrecision                = (-1)                            /* allow as many digits as format*/
  515. };
  516.  
  517. /* 'text'*/
  518.  
  519. struct StringRangeRecord {
  520.     long                             maxChars;                    /* maximum length of string*/
  521.     long                             maxLines;                    /* number of editing lines to use (1 typical, 0 to default)*/
  522. };
  523. typedef struct StringRangeRecord        StringRangeRecord;
  524. /* 'long'*/
  525.  
  526. struct LongRangeRecord {
  527.     long                             minValue;                    /* no less than this*/
  528.     long                             maxValue;                    /* no more than this*/
  529.     long                             scaleValue;                    /* muliply content by this going in, divide going out*/
  530.     long                             precisionDigits;            /* # digits of precision when editing via typing*/
  531. };
  532. typedef struct LongRangeRecord            LongRangeRecord;
  533. /* 'enum'*/
  534.  
  535. struct EnumRangeRecord {
  536.     long                             enumID;                        /* 'enum' list in root container to search within*/
  537. };
  538. typedef struct EnumRangeRecord            EnumRangeRecord;
  539. /* 'fixd'*/
  540.  
  541. struct FixedRangeRecord {
  542.     Fixed                             minValue;                    /* no less than this*/
  543.     Fixed                             maxValue;                    /* no more than this*/
  544.     Fixed                             scaleValue;                    /* muliply content by this going in, divide going out*/
  545.     long                             precisionDigits;            /* # digits of precision when editing via typing*/
  546. };
  547. typedef struct FixedRangeRecord            FixedRangeRecord;
  548. /* 'doub'*/
  549.  
  550.     #define kNoMinimumDouble        (NAN)                    // ignore minimum/maxiumum values
  551.     #define kNoMaximumDouble        (NAN)
  552.     #define kNoScaleDouble            (0)                        // don't perform any scaling of value
  553.     struct DoubleRangeRecord
  554.         {
  555.         QTFloatDouble        minValue;            // no less than this
  556.         QTFloatDouble        maxValue;            // no more than this
  557.         QTFloatDouble        scaleValue;            // muliply content by this going in, divide going out
  558.         long                precisionDigits;    // # digits of precision when editing via typing
  559.         };
  560.     typedef struct DoubleRangeRecord DoubleRangeRecord;
  561.     
  562. /* 'bool'    */
  563.  
  564. struct BooleanRangeRecord {
  565.     long                             maskValue;                    /* value to mask on/off to set/clear the boolean*/
  566. };
  567. typedef struct BooleanRangeRecord        BooleanRangeRecord;
  568. /* 'rgb '*/
  569.  
  570. struct RGBRangeRecord {
  571.     RGBColor                         minColor;
  572.     RGBColor                         maxColor;
  573. };
  574. typedef struct RGBRangeRecord            RGBRangeRecord;
  575. /* 'imag'*/
  576.  
  577. enum {
  578.     kParameterImageNoFlags        = 0
  579. };
  580.  
  581.  
  582. struct ImageRangeRecord {
  583.     long                             imageFlags;
  584. };
  585. typedef struct ImageRangeRecord            ImageRangeRecord;
  586. /* union of all of the above*/
  587.  
  588.     struct ParameterRangeRecord
  589.         {
  590.         union 
  591.             {
  592.             LongRangeRecord        longRange;
  593.             EnumRangeRecord        enumRange;
  594.             FixedRangeRecord    fixedRange;
  595.             DoubleRangeRecord    doubleRange;
  596.             StringRangeRecord    stringRange;
  597.             BooleanRangeRecord    booleanRange;
  598.             RGBRangeRecord        rgbRange;
  599.             ImageRangeRecord    imageRange;
  600.             } u;
  601.         };
  602.     typedef struct ParameterRangeRecord ParameterRangeRecord;
  603.     
  604. /* UI behavior of a parameter*/
  605.  
  606. enum {
  607.     kParameterDataBehavior        = FOUR_CHAR_CODE('ditl')
  608. };
  609.  
  610.  
  611. enum {
  612.                                                                 /* items edited via typing*/
  613.     kParameterItemEditText        = FOUR_CHAR_CODE('edit'),        /* edit text box*/
  614.     kParameterItemEditLong        = FOUR_CHAR_CODE('long'),        /* long number editing box*/
  615.     kParameterItemEditFixed        = FOUR_CHAR_CODE('fixd'),        /* fixed point number editing box*/
  616.     kParameterItemEditDouble    = FOUR_CHAR_CODE('doub'),        /* double number editing box*/
  617.                                                                 /* items edited via control(s)*/
  618.     kParameterItemPopUp            = FOUR_CHAR_CODE('popu'),        /* pop up value for enum types*/
  619.     kParameterItemRadioCluster    = FOUR_CHAR_CODE('radi'),        /* radio cluster for enum types*/
  620.     kParameterItemCheckBox        = FOUR_CHAR_CODE('chex'),        /* check box for booleans*/
  621.     kParameterItemControl        = FOUR_CHAR_CODE('cntl'),        /* item controlled via a standard control of some type*/
  622.                                                                 /* special user items*/
  623.     kParameterItemLine            = FOUR_CHAR_CODE('line'),        /* line*/
  624.     kParameterItemColorPicker    = FOUR_CHAR_CODE('pick'),        /* color swatch & picker*/
  625.     kParameterItemGroupDivider    = FOUR_CHAR_CODE('divi'),        /* start of a new group of items*/
  626.     kParameterItemStaticText    = FOUR_CHAR_CODE('stat'),        /* display "parameter name" as static text*/
  627.     kParameterItemDragImage        = FOUR_CHAR_CODE('imag'),        /* allow image display, along with drag and drop*/
  628.                                                                 /* flags valid for lines and groups*/
  629.     kGraphicsNoFlags            = 0x00000000,                    /* no options for graphics*/
  630.     kGraphicsFlagsGray            = 0x00000001,                    /* draw lines with gray*/
  631.                                                                 /* flags valid for groups*/
  632.     kGroupNoFlags                = 0x00000000,                    /* no options for group -- may be combined with graphics options                        */
  633.     kGroupAlignText                = 0x00010000,                    /* edit text items in group have the same size*/
  634.     kGroupSurroundBox            = 0x00020000,                    /* group should be surrounded with a box*/
  635.     kGroupMatrix                = 0x00040000,                    /* side-by-side arrangement of group is okay*/
  636.     kGroupNoName                = 0x00080000,                    /* name of group should not be displayed above box*/
  637.                                                                 /* flags valid for popup/radiocluster/checkbox/control*/
  638.     kDisableControl                = 0x00000001,
  639.     kDisableWhenNotEqual        = (0x00000000 + kDisableControl),
  640.     kDisableWhenEqual            = (0x00000010 + kDisableControl),
  641.     kDisableWhenLessThan        = (0x00000020 + kDisableControl),
  642.     kDisableWhenGreaterThan        = (0x00000030 + kDisableControl), /* flags valid for popups*/
  643.     kPopupStoreAsString            = 0x00010000
  644. };
  645.  
  646.  
  647. struct ControlBehaviors {
  648.     QTAtomID                         groupID;                    /* group under control of this item*/
  649.     long                             controlValue;                /* control value for comparison purposes*/
  650. };
  651. typedef struct ControlBehaviors            ControlBehaviors;
  652.  
  653. struct ParameterDataBehavior {
  654.     OSType                             behaviorType;
  655.     long                             behaviorFlags;
  656.     union {
  657.         ControlBehaviors                 controls;
  658.     }                                 u;
  659. };
  660. typedef struct ParameterDataBehavior    ParameterDataBehavior;
  661. /* higher level purpose of a parameter or set of parameters*/
  662.  
  663. enum {
  664.     kParameterDataUsage            = FOUR_CHAR_CODE('use ')
  665. };
  666.  
  667.  
  668. enum {
  669.     kParameterUsagePixels        = FOUR_CHAR_CODE('pixl'),
  670.     kParameterUsageRectangle    = FOUR_CHAR_CODE('rect'),
  671.     kParameterUsagePoint        = FOUR_CHAR_CODE('xy  '),
  672.     kParameterUsage3DPoint        = FOUR_CHAR_CODE('xyz '),
  673.     kParameterUsageDegrees        = FOUR_CHAR_CODE('degr'),
  674.     kParameterUsageRadians        = FOUR_CHAR_CODE('rads'),
  675.     kParameterUsagePercent        = FOUR_CHAR_CODE('pcnt'),
  676.     kParameterUsageSeconds        = FOUR_CHAR_CODE('secs'),
  677.     kParameterUsageMilliseconds    = FOUR_CHAR_CODE('msec'),
  678.     kParameterUsageMicroseconds    = FOUR_CHAR_CODE('µsec'),
  679.     kParameterUsage3by3Matrix    = FOUR_CHAR_CODE('3by3')
  680. };
  681.  
  682.  
  683. struct ParameterDataUsage {
  684.     OSType                             usageType;                    /* higher level purpose of the data or group*/
  685. };
  686. typedef struct ParameterDataUsage        ParameterDataUsage;
  687. /* default value(s) for a parameter*/
  688.  
  689. enum {
  690.     kParameterDataDefaultItem    = FOUR_CHAR_CODE('dflt')
  691. };
  692.  
  693. /* atoms that help to fill in data within the info window */
  694.  
  695. enum {
  696.     kParameterInfoLongName        = FOUR_CHAR_CODE('©nam'),
  697.     kParameterInfoCopyright        = FOUR_CHAR_CODE('©cpy'),
  698.     kParameterInfoDescription    = FOUR_CHAR_CODE('©inf'),
  699.     kParameterInfoWindowTitle    = FOUR_CHAR_CODE('©wnt'),
  700.     kParameterInfoPicture        = FOUR_CHAR_CODE('©pix'),
  701.     kParameterInfoManufacturer    = FOUR_CHAR_CODE('©man'),
  702.     kParameterInfoIDs            = 1
  703. };
  704.  
  705. /* flags for ImageCodecValidateParameters */
  706.  
  707. enum {
  708.     kParameterValidationNoFlags    = 0x00000000,
  709.     kParameterValidationFinalValidation = 0x00000001
  710. };
  711.  
  712.  
  713. typedef long                             QTParameterValidationOptions;
  714. /* QTAtomTypes for atoms in image compressor settings containers*/
  715.  
  716. enum {
  717.     kImageCodecSettingsFieldCount = FOUR_CHAR_CODE('fiel'),        /* Number of fields (UInt8) */
  718.     kImageCodecSettingsFieldOrdering = FOUR_CHAR_CODE('fdom'),    /* Ordering of fields (UInt8)*/
  719.     kImageCodecSettingsFieldOrderingF1F2 = 1,
  720.     kImageCodecSettingsFieldOrderingF2F1 = 2
  721. };
  722.  
  723. typedef CALLBACK_API( ComponentResult , ImageCodecMPDrawBandProcPtr )(void *refcon, ImageSubCodecDecompressRecord *drp);
  724. typedef STACK_UPP_TYPE(ImageCodecMPDrawBandProcPtr)             ImageCodecMPDrawBandUPP;
  725. enum { uppImageCodecMPDrawBandProcInfo = 0x000003F0 };             /* pascal 4_bytes Func(4_bytes, 4_bytes) */
  726. #define NewImageCodecMPDrawBandProc(userRoutine)                 (ImageCodecMPDrawBandUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppImageCodecMPDrawBandProcInfo, GetCurrentArchitecture())
  727. #define CallImageCodecMPDrawBandProc(userRoutine, refcon, drp)     CALL_TWO_PARAMETER_UPP((userRoutine), uppImageCodecMPDrawBandProcInfo, (refcon), (drp))
  728. /*    codec selectors 0-127 are reserved by Apple */
  729. /*    codec selectors 128-191 are subtype specific */
  730. /*    codec selectors 192-255 are vendor specific */
  731. /*    codec selectors 256-32767 are available for general use */
  732. /*    negative selectors are reserved by the Component Manager */
  733. EXTERN_API( ComponentResult )
  734. ImageCodecGetCodecInfo            (ComponentInstance         ci,
  735.                                  CodecInfo *            info)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0000, 0x7000, 0xA82A);
  736.  
  737. EXTERN_API( ComponentResult )
  738. ImageCodecGetCompressionTime    (ComponentInstance         ci,
  739.                                  PixMapHandle             src,
  740.                                  const Rect *            srcRect,
  741.                                  short                     depth,
  742.                                  CodecQ *                spatialQuality,
  743.                                  CodecQ *                temporalQuality,
  744.                                  unsigned long *        time)                                FIVEWORDINLINE(0x2F3C, 0x0016, 0x0001, 0x7000, 0xA82A);
  745.  
  746. EXTERN_API( ComponentResult )
  747. ImageCodecGetMaxCompressionSize    (ComponentInstance         ci,
  748.                                  PixMapHandle             src,
  749.                                  const Rect *            srcRect,
  750.                                  short                     depth,
  751.                                  CodecQ                 quality,
  752.                                  long *                    size)                                FIVEWORDINLINE(0x2F3C, 0x0012, 0x0002, 0x7000, 0xA82A);
  753.  
  754. EXTERN_API( ComponentResult )
  755. ImageCodecPreCompress            (ComponentInstance         ci,
  756.                                  CodecCompressParams *    params)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0003, 0x7000, 0xA82A);
  757.  
  758. EXTERN_API( ComponentResult )
  759. ImageCodecBandCompress            (ComponentInstance         ci,
  760.                                  CodecCompressParams *    params)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0004, 0x7000, 0xA82A);
  761.  
  762. EXTERN_API( ComponentResult )
  763. ImageCodecPreDecompress            (ComponentInstance         ci,
  764.                                  CodecDecompressParams * params)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  765.  
  766. EXTERN_API( ComponentResult )
  767. ImageCodecBandDecompress        (ComponentInstance         ci,
  768.                                  CodecDecompressParams * params)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0006, 0x7000, 0xA82A);
  769.  
  770. EXTERN_API( ComponentResult )
  771. ImageCodecBusy                    (ComponentInstance         ci,
  772.                                  ImageSequence             seq)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  773.  
  774. EXTERN_API( ComponentResult )
  775. ImageCodecGetCompressedImageSize (ComponentInstance     ci,
  776.                                  ImageDescriptionHandle  desc,
  777.                                  Ptr                     data,
  778.                                  long                     bufferSize,
  779.                                  ICMDataProcRecordPtr     dataProc,
  780.                                  long *                    dataSize)                            FIVEWORDINLINE(0x2F3C, 0x0014, 0x0008, 0x7000, 0xA82A);
  781.  
  782. EXTERN_API( ComponentResult )
  783. ImageCodecGetSimilarity            (ComponentInstance         ci,
  784.                                  PixMapHandle             src,
  785.                                  const Rect *            srcRect,
  786.                                  ImageDescriptionHandle  desc,
  787.                                  Ptr                     data,
  788.                                  Fixed *                similarity)                            FIVEWORDINLINE(0x2F3C, 0x0014, 0x0009, 0x7000, 0xA82A);
  789.  
  790. EXTERN_API( ComponentResult )
  791. ImageCodecTrimImage                (ComponentInstance         ci,
  792.                                  ImageDescriptionHandle  Desc,
  793.                                  Ptr                     inData,
  794.                                  long                     inBufferSize,
  795.                                  ICMDataProcRecordPtr     dataProc,
  796.                                  Ptr                     outData,
  797.                                  long                     outBufferSize,
  798.                                  ICMFlushProcRecordPtr     flushProc,
  799.                                  Rect *                    trimRect,
  800.                                  ICMProgressProcRecordPtr  progressProc)                    FIVEWORDINLINE(0x2F3C, 0x0024, 0x000A, 0x7000, 0xA82A);
  801.  
  802. EXTERN_API( ComponentResult )
  803. ImageCodecRequestSettings        (ComponentInstance         ci,
  804.                                  Handle                 settings,
  805.                                  Rect *                    rp,
  806.                                  ModalFilterUPP         filterProc)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x000B, 0x7000, 0xA82A);
  807.  
  808. EXTERN_API( ComponentResult )
  809. ImageCodecGetSettings            (ComponentInstance         ci,
  810.                                  Handle                 settings)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x000C, 0x7000, 0xA82A);
  811.  
  812. EXTERN_API( ComponentResult )
  813. ImageCodecSetSettings            (ComponentInstance         ci,
  814.                                  Handle                 settings)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x000D, 0x7000, 0xA82A);
  815.  
  816. EXTERN_API( ComponentResult )
  817. ImageCodecFlush                    (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x000E, 0x7000, 0xA82A);
  818.  
  819. EXTERN_API( ComponentResult )
  820. ImageCodecSetTimeCode            (ComponentInstance         ci,
  821.                                  void *                    timeCodeFormat,
  822.                                  void *                    timeCodeTime)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x000F, 0x7000, 0xA82A);
  823.  
  824. EXTERN_API( ComponentResult )
  825. ImageCodecIsImageDescriptionEquivalent (ComponentInstance  ci,
  826.                                  ImageDescriptionHandle  newDesc,
  827.                                  Boolean *                equivalent)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0010, 0x7000, 0xA82A);
  828.  
  829. EXTERN_API( ComponentResult )
  830. ImageCodecNewMemory                (ComponentInstance         ci,
  831.                                  Ptr *                    data,
  832.                                  Size                     dataSize,
  833.                                  long                     dataUse,
  834.                                  ICMMemoryDisposedUPP     memoryGoneProc,
  835.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0014, 0x0011, 0x7000, 0xA82A);
  836.  
  837. EXTERN_API( ComponentResult )
  838. ImageCodecDisposeMemory            (ComponentInstance         ci,
  839.                                  Ptr                     data)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0012, 0x7000, 0xA82A);
  840.  
  841. EXTERN_API( ComponentResult )
  842. ImageCodecHitTestData            (ComponentInstance         ci,
  843.                                  ImageDescriptionHandle  desc,
  844.                                  void *                    data,
  845.                                  Size                     dataSize,
  846.                                  Point                     where,
  847.                                  Boolean *                hit)                                FIVEWORDINLINE(0x2F3C, 0x0014, 0x0013, 0x7000, 0xA82A);
  848.  
  849. EXTERN_API( ComponentResult )
  850. ImageCodecNewImageBufferMemory    (ComponentInstance         ci,
  851.                                  CodecDecompressParams * params,
  852.                                  long                     flags,
  853.                                  ICMMemoryDisposedUPP     memoryGoneProc,
  854.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0010, 0x0014, 0x7000, 0xA82A);
  855.  
  856. EXTERN_API( ComponentResult )
  857. ImageCodecExtractAndCombineFields (ComponentInstance     ci,
  858.                                  long                     fieldFlags,
  859.                                  void *                    data1,
  860.                                  long                     dataSize1,
  861.                                  ImageDescriptionHandle  desc1,
  862.                                  void *                    data2,
  863.                                  long                     dataSize2,
  864.                                  ImageDescriptionHandle  desc2,
  865.                                  void *                    outputData,
  866.                                  long *                    outDataSize,
  867.                                  ImageDescriptionHandle  descOut)                            FIVEWORDINLINE(0x2F3C, 0x0028, 0x0015, 0x7000, 0xA82A);
  868.  
  869. EXTERN_API( ComponentResult )
  870. ImageCodecGetMaxCompressionSizeWithSources (ComponentInstance  ci,
  871.                                  PixMapHandle             src,
  872.                                  const Rect *            srcRect,
  873.                                  short                     depth,
  874.                                  CodecQ                 quality,
  875.                                  CDSequenceDataSourcePtr  sourceData,
  876.                                  long *                    size)                                FIVEWORDINLINE(0x2F3C, 0x0016, 0x0016, 0x7000, 0xA82A);
  877.  
  878. EXTERN_API( ComponentResult )
  879. ImageCodecSetTimeBase            (ComponentInstance         ci,
  880.                                  void *                    base)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0017, 0x7000, 0xA82A);
  881.  
  882. EXTERN_API( ComponentResult )
  883. ImageCodecSourceChanged            (ComponentInstance         ci,
  884.                                  UInt32                 majorSourceChangeSeed,
  885.                                  UInt32                 minorSourceChangeSeed,
  886.                                  CDSequenceDataSourcePtr  sourceData,
  887.                                  long *                    flagsOut)                            FIVEWORDINLINE(0x2F3C, 0x0010, 0x0018, 0x7000, 0xA82A);
  888.  
  889. EXTERN_API( ComponentResult )
  890. ImageCodecFlushFrame            (ComponentInstance         ci,
  891.                                  UInt32                 flags)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0019, 0x7000, 0xA82A);
  892.  
  893. EXTERN_API( ComponentResult )
  894. ImageCodecGetSettingsAsText        (ComponentInstance         ci,
  895.                                  Handle *                text)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x001A, 0x7000, 0xA82A);
  896.  
  897. EXTERN_API( ComponentResult )
  898. ImageCodecGetParameterListHandle (ComponentInstance     ci,
  899.                                  Handle *                parameterDescriptionHandle)            FIVEWORDINLINE(0x2F3C, 0x0004, 0x001B, 0x7000, 0xA82A);
  900.  
  901. EXTERN_API( ComponentResult )
  902. ImageCodecGetParameterList        (ComponentInstance         ci,
  903.                                  QTAtomContainer *        parameterDescription)                FIVEWORDINLINE(0x2F3C, 0x0004, 0x001C, 0x7000, 0xA82A);
  904.  
  905. EXTERN_API( ComponentResult )
  906. ImageCodecCreateStandardParameterDialog (ComponentInstance  ci,
  907.                                  QTAtomContainer         parameterDescription,
  908.                                  QTAtomContainer         parameters,
  909.                                  QTParameterDialogOptions  dialogOptions,
  910.                                  DialogPtr                 existingDialog,
  911.                                  short                     existingUserItem,
  912.                                  QTParameterDialog *    createdDialog)                        FIVEWORDINLINE(0x2F3C, 0x0016, 0x001D, 0x7000, 0xA82A);
  913.  
  914. EXTERN_API( ComponentResult )
  915. ImageCodecIsStandardParameterDialogEvent (ComponentInstance  ci,
  916.                                  EventRecord *            pEvent,
  917.                                  QTParameterDialog         createdDialog)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x001E, 0x7000, 0xA82A);
  918.  
  919. EXTERN_API( ComponentResult )
  920. ImageCodecDismissStandardParameterDialog (ComponentInstance  ci,
  921.                                  QTParameterDialog         createdDialog)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x001F, 0x7000, 0xA82A);
  922.  
  923. EXTERN_API( ComponentResult )
  924. ImageCodecStandardParameterDialogDoAction (ComponentInstance  ci,
  925.                                  QTParameterDialog         createdDialog,
  926.                                  long                     action,
  927.                                  void *                    params)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0020, 0x7000, 0xA82A);
  928.  
  929. EXTERN_API( ComponentResult )
  930. ImageCodecNewImageGWorld        (ComponentInstance         ci,
  931.                                  CodecDecompressParams * params,
  932.                                  GWorldPtr *            newGW,
  933.                                  long                     flags)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0021, 0x7000, 0xA82A);
  934.  
  935. EXTERN_API( ComponentResult )
  936. ImageCodecDisposeImageGWorld    (ComponentInstance         ci,
  937.                                  GWorldPtr                 theGW)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0022, 0x7000, 0xA82A);
  938.  
  939. EXTERN_API( ComponentResult )
  940. ImageCodecHitTestDataWithFlags    (ComponentInstance         ci,
  941.                                  ImageDescriptionHandle  desc,
  942.                                  void *                    data,
  943.                                  Size                     dataSize,
  944.                                  Point                     where,
  945.                                  long *                    hit,
  946.                                  long                     hitFlags)                            FIVEWORDINLINE(0x2F3C, 0x0018, 0x0023, 0x7000, 0xA82A);
  947.  
  948. EXTERN_API( ComponentResult )
  949. ImageCodecValidateParameters    (ComponentInstance         ci,
  950.                                  QTAtomContainer         parameters,
  951.                                  QTParameterValidationOptions  validationFlags,
  952.                                  StringPtr                 errorString)                        FIVEWORDINLINE(0x2F3C, 0x000C, 0x0024, 0x7000, 0xA82A);
  953.  
  954. EXTERN_API( ComponentResult )
  955. ImageCodecGetBaseMPWorkFunction    (ComponentInstance         ci,
  956.                                  ComponentMPWorkFunctionUPP * workFunction,
  957.                                  void **                refCon,
  958.                                  ImageCodecMPDrawBandUPP  drawProc,
  959.                                  void *                    drawProcRefCon)                        FIVEWORDINLINE(0x2F3C, 0x0010, 0x0025, 0x7000, 0xA82A);
  960.  
  961. EXTERN_API( ComponentResult )
  962. ImageCodecPreflight                (ComponentInstance         ci,
  963.                                  CodecDecompressParams * params)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0200, 0x7000, 0xA82A);
  964.  
  965. EXTERN_API( ComponentResult )
  966. ImageCodecInitialize            (ComponentInstance         ci,
  967.                                  ImageSubCodecDecompressCapabilities * cap)                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0201, 0x7000, 0xA82A);
  968.  
  969. EXTERN_API( ComponentResult )
  970. ImageCodecBeginBand                (ComponentInstance         ci,
  971.                                  CodecDecompressParams * params,
  972.                                  ImageSubCodecDecompressRecord * drp,
  973.                                  long                     flags)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0202, 0x7000, 0xA82A);
  974.  
  975. EXTERN_API( ComponentResult )
  976. ImageCodecDrawBand                (ComponentInstance         ci,
  977.                                  ImageSubCodecDecompressRecord * drp)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x0203, 0x7000, 0xA82A);
  978.  
  979. EXTERN_API( ComponentResult )
  980. ImageCodecEndBand                (ComponentInstance         ci,
  981.                                  ImageSubCodecDecompressRecord * drp,
  982.                                  OSErr                     result,
  983.                                  long                     flags)                                FIVEWORDINLINE(0x2F3C, 0x000A, 0x0204, 0x7000, 0xA82A);
  984.  
  985. EXTERN_API( ComponentResult )
  986. ImageCodecQueueStarting            (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0205, 0x7000, 0xA82A);
  987.  
  988. EXTERN_API( ComponentResult )
  989. ImageCodecQueueStopping            (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0206, 0x7000, 0xA82A);
  990.  
  991. EXTERN_API( ComponentResult )
  992. ImageCodecDroppingFrame            (ComponentInstance         ci,
  993.                                  const ImageSubCodecDecompressRecord * drp)                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0207, 0x7000, 0xA82A);
  994.  
  995.  
  996.  
  997.  
  998. /* selectors for component calls */
  999. enum {
  1000.     kImageCodecGetCodecInfoSelect                    = 0x0000,
  1001.     kImageCodecGetCompressionTimeSelect                = 0x0001,
  1002.     kImageCodecGetMaxCompressionSizeSelect            = 0x0002,
  1003.     kImageCodecPreCompressSelect                    = 0x0003,
  1004.     kImageCodecBandCompressSelect                    = 0x0004,
  1005.     kImageCodecPreDecompressSelect                    = 0x0005,
  1006.     kImageCodecBandDecompressSelect                    = 0x0006,
  1007.     kImageCodecBusySelect                            = 0x0007,
  1008.     kImageCodecGetCompressedImageSizeSelect            = 0x0008,
  1009.     kImageCodecGetSimilaritySelect                    = 0x0009,
  1010.     kImageCodecTrimImageSelect                        = 0x000A,
  1011.     kImageCodecRequestSettingsSelect                = 0x000B,
  1012.     kImageCodecGetSettingsSelect                    = 0x000C,
  1013.     kImageCodecSetSettingsSelect                    = 0x000D,
  1014.     kImageCodecFlushSelect                            = 0x000E,
  1015.     kImageCodecSetTimeCodeSelect                    = 0x000F,
  1016.     kImageCodecIsImageDescriptionEquivalentSelect    = 0x0010,
  1017.     kImageCodecNewMemorySelect                        = 0x0011,
  1018.     kImageCodecDisposeMemorySelect                    = 0x0012,
  1019.     kImageCodecHitTestDataSelect                    = 0x0013,
  1020.     kImageCodecNewImageBufferMemorySelect            = 0x0014,
  1021.     kImageCodecExtractAndCombineFieldsSelect        = 0x0015,
  1022.     kImageCodecGetMaxCompressionSizeWithSourcesSelect = 0x0016,
  1023.     kImageCodecSetTimeBaseSelect                    = 0x0017,
  1024.     kImageCodecSourceChangedSelect                    = 0x0018,
  1025.     kImageCodecFlushFrameSelect                        = 0x0019,
  1026.     kImageCodecGetSettingsAsTextSelect                = 0x001A,
  1027.     kImageCodecGetParameterListHandleSelect            = 0x001B,
  1028.     kImageCodecGetParameterListSelect                = 0x001C,
  1029.     kImageCodecCreateStandardParameterDialogSelect = 0x001D,
  1030.     kImageCodecIsStandardParameterDialogEventSelect = 0x001E,
  1031.     kImageCodecDismissStandardParameterDialogSelect = 0x001F,
  1032.     kImageCodecStandardParameterDialogDoActionSelect = 0x0020,
  1033.     kImageCodecNewImageGWorldSelect                    = 0x0021,
  1034.     kImageCodecDisposeImageGWorldSelect                = 0x0022,
  1035.     kImageCodecHitTestDataWithFlagsSelect            = 0x0023,
  1036.     kImageCodecValidateParametersSelect                = 0x0024,
  1037.     kImageCodecGetBaseMPWorkFunctionSelect            = 0x0025,
  1038.     kImageCodecPreflightSelect                        = 0x0200,
  1039.     kImageCodecInitializeSelect                        = 0x0201,
  1040.     kImageCodecBeginBandSelect                        = 0x0202,
  1041.     kImageCodecDrawBandSelect                        = 0x0203,
  1042.     kImageCodecEndBandSelect                        = 0x0204,
  1043.     kImageCodecQueueStartingSelect                    = 0x0205,
  1044.     kImageCodecQueueStoppingSelect                    = 0x0206,
  1045.     kImageCodecDroppingFrameSelect                    = 0x0207
  1046. };
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057. enum {
  1058.     kMotionJPEGTag                = FOUR_CHAR_CODE('mjpg'),
  1059.     kJPEGQuantizationTablesImageDescriptionExtension = FOUR_CHAR_CODE('mjqt'),
  1060.     kJPEGHuffmanTablesImageDescriptionExtension = FOUR_CHAR_CODE('mjht'),
  1061.     kFieldInfoImageDescriptionExtension = FOUR_CHAR_CODE('fiel') /* image description extension describing the field count and field orderings*/
  1062. };
  1063.  
  1064.  
  1065. enum {
  1066.     kFieldOrderUnknown            = 0,
  1067.     kFieldsStoredF1F2DisplayedF1F2 = 1,
  1068.     kFieldsStoredF1F2DisplayedF2F1 = 2,
  1069.     kFieldsStoredF2F1DisplayedF1F2 = 5,
  1070.     kFieldsStoredF2F1DisplayedF2F1 = 6
  1071. };
  1072.  
  1073.  
  1074. struct MotionJPEGApp1Marker {
  1075.     long                             unused;
  1076.     long                             tag;
  1077.     long                             fieldSize;
  1078.     long                             paddedFieldSize;
  1079.     long                             offsetToNextField;
  1080.     long                             qTableOffset;
  1081.     long                             huffmanTableOffset;
  1082.     long                             sofOffset;
  1083.     long                             sosOffset;
  1084.     long                             soiOffset;
  1085. };
  1086. typedef struct MotionJPEGApp1Marker        MotionJPEGApp1Marker;
  1087.  
  1088. struct FieldInfoImageDescriptionExtension {
  1089.     UInt8                             fieldCount;
  1090.     UInt8                             fieldOrderings;
  1091. };
  1092. typedef struct FieldInfoImageDescriptionExtension FieldInfoImageDescriptionExtension;
  1093.  
  1094. EXTERN_API( ComponentResult )
  1095. QTPhotoSetSampling                (ComponentInstance         codec,
  1096.                                  short                     yH,
  1097.                                  short                     yV,
  1098.                                  short                     cbH,
  1099.                                  short                     cbV,
  1100.                                  short                     crH,
  1101.                                  short                     crV)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0100, 0x7000, 0xA82A);
  1102.  
  1103. EXTERN_API( ComponentResult )
  1104. QTPhotoSetRestartInterval        (ComponentInstance         codec,
  1105.                                  unsigned short         restartInterval)                    FIVEWORDINLINE(0x2F3C, 0x0002, 0x0101, 0x7000, 0xA82A);
  1106.  
  1107. EXTERN_API( ComponentResult )
  1108. QTPhotoDefineHuffmanTable        (ComponentInstance         codec,
  1109.                                  short                     componentNumber,
  1110.                                  Boolean                 isDC,
  1111.                                  unsigned char *        lengthCounts,
  1112.                                  unsigned char *        values)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0102, 0x7000, 0xA82A);
  1113.  
  1114. EXTERN_API( ComponentResult )
  1115. QTPhotoDefineQuantizationTable    (ComponentInstance         codec,
  1116.                                  short                     componentNumber,
  1117.                                  unsigned char *        table)                                FIVEWORDINLINE(0x2F3C, 0x0006, 0x0103, 0x7000, 0xA82A);
  1118.  
  1119.  
  1120. /* selectors for component calls */
  1121. enum {
  1122.     kQTPhotoSetSamplingSelect                        = 0x0100,
  1123.     kQTPhotoSetRestartIntervalSelect                = 0x0101,
  1124.     kQTPhotoDefineHuffmanTableSelect                = 0x0102,
  1125.     kQTPhotoDefineQuantizationTableSelect            = 0x0103
  1126. };
  1127.  
  1128.  
  1129.  
  1130.  
  1131. /* source identifier -- placed in root container of description, one or more required */
  1132.  
  1133. enum {
  1134.     kEffectSourceName            = FOUR_CHAR_CODE('src ')
  1135. };
  1136.  
  1137.  
  1138. /* source type -- placed in the input map to identify the source kind */
  1139.  
  1140. enum {
  1141.     kEffectDataSourceType        = FOUR_CHAR_CODE('dtst')
  1142. };
  1143.  
  1144. /*  default effect types */
  1145.  
  1146. enum {
  1147.     kEffectRawSource            = 0,                            /* the source is raw image data*/
  1148.     kEffectGenericType            = FOUR_CHAR_CODE('geff')        /* generic effect for combining others*/
  1149. };
  1150.  
  1151. typedef struct EffectSource             EffectSource;
  1152.  
  1153. typedef EffectSource *                    EffectSourcePtr;
  1154.  
  1155. union SourceData {
  1156.     CDSequenceDataSourcePtr         image;
  1157.     EffectSourcePtr                 effect;
  1158. };
  1159. typedef union SourceData                SourceData;
  1160.  
  1161.  
  1162. struct EffectSource {
  1163.     long                             effectType;                    /* type of effect or kEffectRawSource if raw ICM data*/
  1164.     Ptr                             data;                        /* track data for this effect*/
  1165.     SourceData                         source;                        /* source/effect pointers*/
  1166.     EffectSourcePtr                 next;                        /* the next source for the parent effect*/
  1167. };
  1168.  
  1169.  
  1170. struct EffectsFrameParams {
  1171.     ICMFrameTimeRecord                 frameTime;                    /* timing data*/
  1172.     long                             effectDuration;                /* the duration of a single effect frame*/
  1173.     Boolean                         doAsync;                    /* set to true if the effect can go async*/
  1174.     unsigned char                     pad[3];
  1175.     EffectSourcePtr                 source;                        /* ptr to the source input tree*/
  1176.     void *                            refCon;                        /* storage for the effect*/
  1177. };
  1178. typedef struct EffectsFrameParams        EffectsFrameParams;
  1179. typedef EffectsFrameParams *            EffectsFrameParamsPtr;
  1180.  
  1181.  
  1182. EXTERN_API( ComponentResult )
  1183. ImageCodecEffectSetup            (ComponentInstance         effect,
  1184.                                  CodecDecompressParams * p)                                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0300, 0x7000, 0xA82A);
  1185.  
  1186. EXTERN_API( ComponentResult )
  1187. ImageCodecEffectBegin            (ComponentInstance         effect,
  1188.                                  CodecDecompressParams * p,
  1189.                                  EffectsFrameParamsPtr     ePtr)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0301, 0x7000, 0xA82A);
  1190.  
  1191. EXTERN_API( ComponentResult )
  1192. ImageCodecEffectRenderFrame        (ComponentInstance         effect,
  1193.                                  EffectsFrameParamsPtr     p)                                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0302, 0x7000, 0xA82A);
  1194.  
  1195. EXTERN_API( ComponentResult )
  1196. ImageCodecEffectConvertEffectSourceToFormat (ComponentInstance  effect,
  1197.                                  EffectSourcePtr         sourceToConvert,
  1198.                                  ImageDescriptionHandle  requestedDesc)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x0303, 0x7000, 0xA82A);
  1199.  
  1200. EXTERN_API( ComponentResult )
  1201. ImageCodecEffectCancel            (ComponentInstance         effect,
  1202.                                  EffectsFrameParamsPtr     p)                                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0304, 0x7000, 0xA82A);
  1203.  
  1204. EXTERN_API( ComponentResult )
  1205. ImageCodecEffectGetSpeed        (ComponentInstance         effect,
  1206.                                  QTAtomContainer         parameters,
  1207.                                  Fixed *                pFPS)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0305, 0x7000, 0xA82A);
  1208.  
  1209.  
  1210.  
  1211. /* selectors for component calls */
  1212. enum {
  1213.     kImageCodecEffectSetupSelect                    = 0x0300,
  1214.     kImageCodecEffectBeginSelect                    = 0x0301,
  1215.     kImageCodecEffectRenderFrameSelect                = 0x0302,
  1216.     kImageCodecEffectConvertEffectSourceToFormatSelect = 0x0303,
  1217.     kImageCodecEffectCancelSelect                    = 0x0304,
  1218.     kImageCodecEffectGetSpeedSelect                    = 0x0305
  1219. };
  1220.  
  1221.  
  1222. /* curve atom types and data structures */
  1223.  
  1224. enum {
  1225.     kCurvePathAtom                = FOUR_CHAR_CODE('path'),
  1226.     kCurveEndAtom                = FOUR_CHAR_CODE('zero'),
  1227.     kCurveAntialiasControlAtom    = FOUR_CHAR_CODE('anti'),
  1228.     kCurveAntialiasOff            = 0,
  1229.     kCurveAntialiasOn            = (long)0xFFFFFFFF,
  1230.     kCurveFillTypeAtom            = FOUR_CHAR_CODE('fill'),
  1231.     kCurvePenThicknessAtom        = FOUR_CHAR_CODE('pent'),
  1232.     kCurveMiterLimitAtom        = FOUR_CHAR_CODE('mitr'),
  1233.     kCurveJoinAttributesAtom    = FOUR_CHAR_CODE('join'),
  1234.     kCurveMinimumDepthAtom        = FOUR_CHAR_CODE('mind'),
  1235.     kCurveDepthAlwaysOffscreenMask = (long)0x80000000,
  1236.     kCurveTransferModeAtom        = FOUR_CHAR_CODE('xfer'),
  1237.     kCurveGradientAngleAtom        = FOUR_CHAR_CODE('angl'),
  1238.     kCurveGradientRadiusAtom    = FOUR_CHAR_CODE('radi'),
  1239.     kCurveGradientOffsetAtom    = FOUR_CHAR_CODE('cent')
  1240. };
  1241.  
  1242.  
  1243. enum {
  1244.     kCurveARGBColorAtom            = FOUR_CHAR_CODE('argb')
  1245. };
  1246.  
  1247.  
  1248. struct ARGBColor {
  1249.     unsigned short                     alpha;
  1250.     unsigned short                     red;
  1251.     unsigned short                     green;
  1252.     unsigned short                     blue;
  1253. };
  1254. typedef struct ARGBColor                ARGBColor;
  1255.  
  1256. enum {
  1257.     kCurveGradientRecordAtom    = FOUR_CHAR_CODE('grad')
  1258. };
  1259.  
  1260.  
  1261. struct GradientColorRecord {
  1262.     ARGBColor                         thisColor;
  1263.     Fixed                             endingPercentage;
  1264. };
  1265. typedef struct GradientColorRecord        GradientColorRecord;
  1266.  
  1267. typedef GradientColorRecord *            GradientColorPtr;
  1268.  
  1269. enum {
  1270.     kCurveGradientTypeAtom        = FOUR_CHAR_CODE('grdt')
  1271. };
  1272.  
  1273. /* currently supported gradient types */
  1274.  
  1275. enum {
  1276.     kLinearGradient                = 0,
  1277.     kCircularGradient            = 1
  1278. };
  1279.  
  1280. typedef long                             GradientType;
  1281. EXTERN_API( ComponentResult )
  1282. CurveGetLength                    (ComponentInstance         effect,
  1283.                                  gxPaths *                target,
  1284.                                  long                     index,
  1285.                                  wide *                    wideLength)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0100, 0x7000, 0xA82A);
  1286.  
  1287. EXTERN_API( ComponentResult )
  1288. CurveLengthToPoint                (ComponentInstance         effect,
  1289.                                  gxPaths *                target,
  1290.                                  long                     index,
  1291.                                  Fixed                     length,
  1292.                                  FixedPoint *            location,
  1293.                                  FixedPoint *            tangent)                            FIVEWORDINLINE(0x2F3C, 0x0014, 0x0101, 0x7000, 0xA82A);
  1294.  
  1295. EXTERN_API( ComponentResult )
  1296. CurveNewPath                    (ComponentInstance         effect,
  1297.                                  Handle *                pPath)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0102, 0x7000, 0xA82A);
  1298.  
  1299. EXTERN_API( ComponentResult )
  1300. CurveCountPointsInPath            (ComponentInstance         effect,
  1301.                                  gxPaths *                aPath,
  1302.                                  unsigned long             contourIndex,
  1303.                                  unsigned long *        pCount)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0103, 0x7000, 0xA82A);
  1304.  
  1305. EXTERN_API( ComponentResult )
  1306. CurveGetPathPoint                (ComponentInstance         effect,
  1307.                                  gxPaths *                aPath,
  1308.                                  unsigned long             contourIndex,
  1309.                                  unsigned long             pointIndex,
  1310.                                  gxPoint *                thePoint,
  1311.                                  Boolean *                ptIsOnPath)                            FIVEWORDINLINE(0x2F3C, 0x0014, 0x0104, 0x7000, 0xA82A);
  1312.  
  1313. EXTERN_API( ComponentResult )
  1314. CurveInsertPointIntoPath        (ComponentInstance         effect,
  1315.                                  gxPoint *                aPoint,
  1316.                                  Handle                 thePath,
  1317.                                  unsigned long             contourIndex,
  1318.                                  unsigned long             pointIndex,
  1319.                                  Boolean                 ptIsOnPath)                            FIVEWORDINLINE(0x2F3C, 0x0012, 0x0105, 0x7000, 0xA82A);
  1320.  
  1321. EXTERN_API( ComponentResult )
  1322. CurveSetPathPoint                (ComponentInstance         effect,
  1323.                                  gxPaths *                aPath,
  1324.                                  unsigned long             contourIndex,
  1325.                                  unsigned long             pointIndex,
  1326.                                  gxPoint *                thePoint,
  1327.                                  Boolean                 ptIsOnPath)                            FIVEWORDINLINE(0x2F3C, 0x0012, 0x0106, 0x7000, 0xA82A);
  1328.  
  1329. EXTERN_API( ComponentResult )
  1330. CurveGetNearestPathPoint        (ComponentInstance         effect,
  1331.                                  gxPaths *                aPath,
  1332.                                  FixedPoint *            thePoint,
  1333.                                  unsigned long *        contourIndex,
  1334.                                  unsigned long *        pointIndex,
  1335.                                  Fixed *                theDelta)                            FIVEWORDINLINE(0x2F3C, 0x0014, 0x0107, 0x7000, 0xA82A);
  1336.  
  1337. EXTERN_API( ComponentResult )
  1338. CurvePathPointToLength            (ComponentInstance         ci,
  1339.                                  gxPaths *                aPath,
  1340.                                  Fixed                     startDist,
  1341.                                  Fixed                     endDist,
  1342.                                  FixedPoint *            thePoint,
  1343.                                  Fixed *                pLength)                            FIVEWORDINLINE(0x2F3C, 0x0014, 0x0108, 0x7000, 0xA82A);
  1344.  
  1345. EXTERN_API( ComponentResult )
  1346. CurveCreateVectorStream            (ComponentInstance         effect,
  1347.                                  Handle *                pStream)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0109, 0x7000, 0xA82A);
  1348.  
  1349. EXTERN_API( ComponentResult )
  1350. CurveAddAtomToVectorStream        (ComponentInstance         effect,
  1351.                                  OSType                 atomType,
  1352.                                  Size                     atomSize,
  1353.                                  void *                    pAtomData,
  1354.                                  Handle                 vectorStream)                        FIVEWORDINLINE(0x2F3C, 0x0010, 0x010A, 0x7000, 0xA82A);
  1355.  
  1356. EXTERN_API( ComponentResult )
  1357. CurveAddPathAtomToVectorStream    (ComponentInstance         effect,
  1358.                                  Handle                 pathData,
  1359.                                  Handle                 vectorStream)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x010B, 0x7000, 0xA82A);
  1360.  
  1361. EXTERN_API( ComponentResult )
  1362. CurveAddZeroAtomToVectorStream    (ComponentInstance         effect,
  1363.                                  Handle                 vectorStream)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x010C, 0x7000, 0xA82A);
  1364.  
  1365. EXTERN_API( ComponentResult )
  1366. CurveGetAtomDataFromVectorStream (ComponentInstance     effect,
  1367.                                  Handle                 vectorStream,
  1368.                                  long                     atomType,
  1369.                                  long *                    dataSize,
  1370.                                  Ptr *                    dataPtr)                            FIVEWORDINLINE(0x2F3C, 0x0010, 0x010D, 0x7000, 0xA82A);
  1371.  
  1372.  
  1373.  
  1374. /* selectors for component calls */
  1375. enum {
  1376.     kCurveGetLengthSelect                            = 0x0100,
  1377.     kCurveLengthToPointSelect                        = 0x0101,
  1378.     kCurveNewPathSelect                                = 0x0102,
  1379.     kCurveCountPointsInPathSelect                    = 0x0103,
  1380.     kCurveGetPathPointSelect                        = 0x0104,
  1381.     kCurveInsertPointIntoPathSelect                    = 0x0105,
  1382.     kCurveSetPathPointSelect                        = 0x0106,
  1383.     kCurveGetNearestPathPointSelect                    = 0x0107,
  1384.     kCurvePathPointToLengthSelect                    = 0x0108,
  1385.     kCurveCreateVectorStreamSelect                    = 0x0109,
  1386.     kCurveAddAtomToVectorStreamSelect                = 0x010A,
  1387.     kCurveAddPathAtomToVectorStreamSelect            = 0x010B,
  1388.     kCurveAddZeroAtomToVectorStreamSelect            = 0x010C,
  1389.     kCurveGetAtomDataFromVectorStreamSelect            = 0x010D
  1390. };
  1391. /* UPP call backs */
  1392.  
  1393. #if PRAGMA_STRUCT_ALIGN
  1394.     #pragma options align=reset
  1395. #elif PRAGMA_STRUCT_PACKPUSH
  1396.     #pragma pack(pop)
  1397. #elif PRAGMA_STRUCT_PACK
  1398.     #pragma pack()
  1399. #endif
  1400.  
  1401. #ifdef PRAGMA_IMPORT_OFF
  1402. #pragma import off
  1403. #elif PRAGMA_IMPORT
  1404. #pragma import reset
  1405. #endif
  1406.  
  1407. #ifdef __cplusplus
  1408. }
  1409. #endif
  1410.  
  1411. #endif /* __IMAGECODEC__ */
  1412.  
  1413.